package com.bmps.springcloud.insuredmicroservice.service.underwrite.strategy.minordeath.riskstrategy;

import com.bmps.springcloud.insuredmicroservice.constant.accept.StrategyConstant;
import com.bmps.springcloud.insuredmicroservice.model.accept.LcPolModel;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

/**
 * description:
 * AAT070
 *
 * @author jackdaw
 * @date 2020-01-08 11:56
 */
@Component
public class Aat070RiskStrategy implements RiskStrategy {
    @Override
    public BigDecimal getAmount(LcPolModel lcPolModel, List<LcPolModel> lcPolModels, boolean current) {
        if (lcPolModel.getInsuredAppAge() < StrategyConstant.ADULT_AGE) {
            return lcPolModel.getAmnt().multiply(BigDecimal.valueOf(3));
        }
        return BigDecimal.valueOf(0);
    }
}
